package com.hu.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hu.common.annotation.Excel;
import com.hu.common.core.domain.BaseEntity;

/**
 * 利润统计对象 profit_statistics
 *
 * @author hu
 * @date 2025-01-21
 */
public class ProfitStatistics extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * SKU编码
     */
    @Excel(name = "SKU编码")
    private String sku;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String productName;

    /**
     * SKU属性
     */
    @Excel(name = "SKU属性")
    private String skuAttr;

    /**
     * SKU货号（非数据库字段，从product_info关联查询）
     */
    @Excel(name = "SKU货号")
    private String skuCode;

    /**
     * 所属店铺ID
     */
    private Long shopId;

    /**
     * 所属店铺名称
     */
    @Excel(name = "所属店铺")
    private String shopName;

    /**
     * 备货总数量（从备货出库表统计）
     */
    @Excel(name = "备货总数量")
    private Integer totalStockQuantity;

    /**
     * 销售总数量（从回款明细表统计）
     */
    @Excel(name = "销售总数量")
    private Integer totalSalesQuantity;

    /**
     * 售后总数量（从售后明细表统计记录条数）
     */
    @Excel(name = "售后总数量")
    private Integer totalAftersaleQuantity;

    /**
     * 总收入金额（从回款明细表统计）
     */
    @Excel(name = "收入金额")
    private BigDecimal totalIncomeAmount;

    /**
     * 售后总金额（从售后明细汇总）
     */
    @Excel(name = "售后总金额")
    private BigDecimal totalAftersaleAmount;

    /**
     * 产品单价（从采购记录获取平均值）
     */
    private BigDecimal unitPrice;

    /**
     * 物流费用（从备货出库表统计）
     */
    private BigDecimal logisticsFee;

    /**
     * 产品状态（从产品表获取）
     */
    @Excel(name = "产品状态", readConverterExp = "1=已下架,2=已上架,3=上新备货,4=清库存")
    private String productStatus;

    /**
     * 产品单个平均成本（计算得出）
     */
    @Excel(name = "产品平均成本")
    private BigDecimal productAvgCost;

    /**
     * 产品总成本（计算得出）
     */
    @Excel(name = "产品总成本")
    private BigDecimal productTotalCost;

    /**
     * 利润（计算得出）
     */
    @Excel(name = "利润")
    private BigDecimal profit;

    /**
     * 利润率（计算得出，百分比）
     */
    @Excel(name = "利润率(%)")
    private BigDecimal profitRate;

    /**
     * 售后率（计算得出，百分比）
     */
    @Excel(name = "售后率(%)")
    private BigDecimal aftersaleRate;

    /** 开始日期（查询参数） */
    private String beginDate;

    /** 结束日期（查询参数） */
    private String endDate;

    /** 利润率筛选范围（查询参数）：low=30%以下, medium=30%-50%, high=50%以上 */
    private String profitRateRange;

    public void setSku(String sku) {
        this.sku = sku;
    }

    public String getSku() {
        return sku;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductName() {
        return productName;
    }

    public void setSkuAttr(String skuAttr) {
        this.skuAttr = skuAttr;
    }

    public String getSkuAttr() {
        return skuAttr;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopName() {
        return shopName;
    }

    public void setTotalStockQuantity(Integer totalStockQuantity) {
        this.totalStockQuantity = totalStockQuantity;
    }

    public Integer getTotalStockQuantity() {
        return totalStockQuantity;
    }

    public void setTotalSalesQuantity(Integer totalSalesQuantity) {
        this.totalSalesQuantity = totalSalesQuantity;
    }

    public Integer getTotalSalesQuantity() {
        return totalSalesQuantity;
    }

    public void setTotalAftersaleQuantity(Integer totalAftersaleQuantity) {
        this.totalAftersaleQuantity = totalAftersaleQuantity;
    }

    public Integer getTotalAftersaleQuantity() {
        return totalAftersaleQuantity;
    }

    public void setTotalIncomeAmount(BigDecimal totalIncomeAmount) {
        this.totalIncomeAmount = totalIncomeAmount;
    }

    public BigDecimal getTotalIncomeAmount() {
        return totalIncomeAmount;
    }

    public void setTotalAftersaleAmount(BigDecimal totalAftersaleAmount) {
        this.totalAftersaleAmount = totalAftersaleAmount;
    }

    public BigDecimal getTotalAftersaleAmount() {
        return totalAftersaleAmount;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setLogisticsFee(BigDecimal logisticsFee) {
        this.logisticsFee = logisticsFee;
    }

    public BigDecimal getLogisticsFee() {
        return logisticsFee;
    }

    public void setProductStatus(String productStatus) {
        this.productStatus = productStatus;
    }

    public String getProductStatus() {
        return productStatus;
    }

    public void setProductAvgCost(BigDecimal productAvgCost) {
        this.productAvgCost = productAvgCost;
    }

    public BigDecimal getProductAvgCost() {
        return productAvgCost;
    }

    public void setProductTotalCost(BigDecimal productTotalCost) {
        this.productTotalCost = productTotalCost;
    }

    public BigDecimal getProductTotalCost() {
        return productTotalCost;
    }

    public void setProfit(BigDecimal profit) {
        this.profit = profit;
    }

    public BigDecimal getProfit() {
        return profit;
    }

    public void setProfitRate(BigDecimal profitRate) {
        this.profitRate = profitRate;
    }

    public BigDecimal getProfitRate() {
        return profitRate;
    }

    public void setAftersaleRate(BigDecimal aftersaleRate) {
        this.aftersaleRate = aftersaleRate;
    }

    public BigDecimal getAftersaleRate() {
        return aftersaleRate;
    }

    public String getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(String beginDate) {
        this.beginDate = beginDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getProfitRateRange() {
        return profitRateRange;
    }

    public void setProfitRateRange(String profitRateRange) {
        this.profitRateRange = profitRateRange;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("sku", getSku())
                .append("productName", getProductName())
                .append("skuAttr", getSkuAttr())
                .append("skuCode", getSkuCode())
                .append("shopId", getShopId())
                .append("shopName", getShopName())
                .append("totalStockQuantity", getTotalStockQuantity())
                .append("totalSalesQuantity", getTotalSalesQuantity())
                .append("totalAftersaleQuantity", getTotalAftersaleQuantity())
                .append("totalIncomeAmount", getTotalIncomeAmount())
                .append("totalAftersaleAmount", getTotalAftersaleAmount())
                .append("unitPrice", getUnitPrice())
                .append("logisticsFee", getLogisticsFee())
                .append("productStatus", getProductStatus())
                .append("productAvgCost", getProductAvgCost())
                .append("productTotalCost", getProductTotalCost())
                .append("profit", getProfit())
                .append("profitRate", getProfitRate())
                .append("aftersaleRate", getAftersaleRate())
                .toString();
    }
}

